var FtpDeploy = require("ftp-deploy");
var ftpDeploy = new FtpDeploy();

var config = {
    user: "tv_ailipai",
    password: "m57aJk3BfYwfkfNy",
    host: "116.10.184.230",
    port: 21,
    localRoot: "D:\\ff_test\\out\\1\\1080p\\",
    remoteRoot: "/tv/368/1/1080p/",
    include: ["*"],
};

ftpDeploy.on("uploading", function(data) {
    console.log(data.totalFilesCount); // total file count being transferred
    console.log(data.transferredFileCount); // number of files transferred
    console.log(data.filename); // partial path with filename being uploaded
});
ftpDeploy.on("uploaded", function(data) {
    console.log(data); // same data as uploading event
});
ftpDeploy.on("log", function(data) {
    console.log(data); // same data as uploading event
});
ftpDeploy.on("upload-error", function(data) {
    console.log(data.err); // data will also include filename, relativePath, and other goodies
});

ftpDeploy.deploy(config)
    .then(res => console.log("finished:", res))
    .catch(err => console.log(err));